package cn.wolfcode.wolfcodemall.service;

import cn.wolfcode.wolfcodemall.domain.Product;
import cn.wolfcode.wolfcodemall.qo.PageQo;
import cn.wolfcode.wolfcodemall.qo.ProductQo;
import cn.wolfcode.wolfcodemall.vo.ProductVo;
import com.github.pagehelper.PageInfo;
import org.apache.ibatis.annotations.Param;

import java.util.Date;
import java.util.List;

public interface ProductService {
    //分页查询商品信息
    PageInfo<Product> selectByPage(PageQo qo);

    //条件查询
    PageInfo<Product> selectByCondition(ProductQo qo);

    //保存或更新
    void saveOrUpdate(ProductVo vo);

    //根据id查询商品信息
    Product selectById(Integer productId);

    List<Product> selectHomeProductByCategoryId(Integer categoryId);

    //根据商品名字查询商品信息
    List<Product> selectByUser(String productName);

    //根据日期排序
    List <Product> selectBySort(String orderField, String orderType);

    List<Product> selectByCategoryId(@Param("categoryId") Integer categoryId);
}
